package com.hgd.thread;

import java.util.Date;

public class RunTime implements Comparable{
	private Date startTime = new Date(); 
	private Date endTime = new Date(); 
	private Long usingTime;
	
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public long getUsingTime() {
		return usingTime;
	}
	public void setUsingTime(long usingTime) {
		this.usingTime = usingTime;
	}
	public int compareTo(Object o) {
		RunTime runTime = (RunTime) o;
		int result  = this.startTime.before(runTime.startTime)?1:(this.startTime==runTime.startTime?0:-1);		
		if (result==0) {
			result = this.usingTime.compareTo(runTime.usingTime);
		}		
		return result;
	}
	
}
